#include <2025Linux.h>
int main(int argc, char *argv[])
{
    // ./06_client_send_recv 192.168.72.128 12345
    ARGS_CHECK(argc,3);
    // 赋值是具体类型
    struct sockaddr_in addr;
    addr.sin_family = AF_INET; // ipv4
    addr.sin_port =  htons(atoi(argv[2])); // "12345" --> 小端 12345 --> 大端 12345
    addr.sin_addr.s_addr = inet_addr(argv[1]);
    // 创建文件对象 socket
    int sockfd = socket(AF_INET,SOCK_STREAM,0);
    ERROR_CHECK(sockfd,-1,"socket");
    // connect到服务端
    int ret = connect(sockfd,(struct sockaddr *)&addr,sizeof(addr));
    ERROR_CHECK(ret,-1,"connect");

    send(sockfd,"hello",5,0);
    send(sockfd,"world",5,0);
    return 0;
}

